﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AlarmManagePlatform.DataAccess
{
    internal class tb_MobileTerminalGpsInfo
    {
        internal void add(string deviceNumber,float latitude,float longitude,string desc,string uploadDate)
        {
            Relations.DBUtility.SqlServer.SqlDb sqlDb = null;
            try
            {
                string sqlScript = string.Format("Insert Into tb_MobileTerminalGpsInfo(deviceNumber latitude,longitude,desc,CreateTime) values ('{0}',{1},{2},'{3}','{4}');"
                    ,deviceNumber,latitude,longitude,desc, uploadDate);
                sqlDb = Static.Methods.OpenDataBase();
                sqlDb.UpdateSqlScript(sqlScript);
            }
            catch (Exception ex)
            {
                throw new Exception("保存移动终端GPS信息失败，错误信息：" + ex.Message);
            }
            finally
            {
                if (sqlDb != null)
                    Static.Methods.CloseDataBase(sqlDb);
            }
        }
    }
}